package m.jclecai.com.ui;

import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.os.CountDownTimer;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.gongwen.marqueen.MarqueeView;
import com.squareup.okhttp.Request;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;

import butterknife.OnClick;
import m.jclecai.com.R;
import m.jclecai.com.activity.LottoTrendActivity;
import m.jclecai.com.activity.ProbabilityOfCodeActivity;
import m.jclecai.com.activity.WebHelperActivity;
import m.jclecai.com.adapter.BallsAdapter;
import m.jclecai.com.adapter.SelectBoxAdapter;
import m.jclecai.com.base.BaseActivity;
import m.jclecai.com.bean.BallItem;
import m.jclecai.com.bean.IssueInfoBean;
import m.jclecai.com.bean.MissDataBean;
import m.jclecai.com.bean.common.MissDataTrendBean;
import m.jclecai.com.constant.Constant_Result;
import m.jclecai.com.constant.Constant_Url;
import m.jclecai.com.contents.LotteryType;
import m.jclecai.com.fragment.BetTrendFragment;
import m.jclecai.com.inter.IAdapterChange;
import m.jclecai.com.inter.OnItemClick;
import m.jclecai.com.pop.SYXW_Center_PopupWindow;
import m.jclecai.com.utils.BaseUtils;
import m.jclecai.com.utils.MakeRandomUtil;
import m.jclecai.com.utils.PreferenceUtil;
import m.jclecai.com.utils.ShakeUtils;
import m.jclecai.com.utils.ToastUtil;
import m.jclecai.com.utils.http.FastOk;
import m.jclecai.com.utils.http.HttpManager;
import m.jclecai.com.view.BallGridView;
import m.jclecai.com.view.NoticeMFView;
import m.jclecai.com.view.common.BottomBar;
import m.jclecai.com.view.common.VeticalDrawerLayout;
import q.rorbin.badgeview.Badge;

/**
 * Created by hp on 2017/3/31.
 * <p>
 * 11选5 选号界面
 */

public class BetSYXWActivity extends BaseActivity {
    private String type;
    //提示
    private TextView tv_hint;

    private BallsAdapter itemOneAdapter, itemTwoAdapter, itemThreeAdapter;
    private LinearLayout ll_item_one, ll_item_two, ll_item_three;
    //位置标识
    private TextView tv_position_one, tv_position_two, tv_position_three;
    //选号控件
    private BallGridView gridview_item_one, gridview_item_two, gridview_item_three;
    //分割线
    private RelativeLayout line_one, line_two;
    //球总数
    private int ballCount;
    //注数金额
    private TextView tv_number_money;
    //截止时间
    private TextView tv_date;
    private int countOne, countTwo, countThree;

    private List<String> codeOne = new LinkedList<>();
    private List<String> codeTwo = new LinkedList<>();
    private List<String> codeThree = new LinkedList<>();

    private ImageView iv_add_selector;
    private TextView tv_count;
    private PopupWindow pop;
    private SYXW_Center_PopupWindow selectBoxPop;

    private GridView gv_selectBox;
    private SelectBoxAdapter adapter;
    private String[] ordinaryMode;
    private String[] ordinaryBonus;
    private String[] duplexMode, lxMode;
    private String[] duplexBonus, lxBonus;
    private IssueInfoBean bean;
    //随机选号个数
    private int number;
    //是否是单选
    private boolean isRadio;
    //item个数
    private int itemCount;
    //玩法模式
    private String modes = "任选二";
    private CountDownTimer timer;
    private TextView tv_term;
    //普通玩法还是胆拖玩法
    private int currentPosition;
    private int checked;

    //最大胆码个数
    private int courageCount;

    private ArrayList<String> mode = new ArrayList<>();
    private ArrayList<String> numMoney = new ArrayList<>();
    private ArrayList<String> ballNumber = new ArrayList<>();
    private int totalMoney;
    private int totalNum;
    private ImageView iv_shake;
    private TextView tv_pull_hint;
    private TextView tv_courage_hint;

    //===========后来重新增加的部分===============
    private VeticalDrawerLayout mDrawerLayout;
    //    private ListView mLvHistory;
    private View mIvDateUnfold;
    //    private PLS_SD_QXCA_LotteryAdapter mhistoryAdapter;
    private BottomBar mBottomBar;

    //是否显示遗漏的textView;
    private TextView mTvMissData;
    private String mSubTitle;

    //    @BindView(R.id.ltv_trendView)
//    LottoTrendView ltvTrendView;
    //走势图
//    private DDTrendChart mTrendChart;
    BetTrendFragment trendFragment;
    private MissDataBean mMissData;
    private MarqueeView mMarqueen;
    private View mLlQarqueeView;
    private NoticeMFView mNoticeMFView;
    private View mFlMarquee;
    private ShakeUtils mShakeUtils;
    private TextView tv_loading;

    @Override
    protected int getContentView() {
        return R.layout.betting_syxw_activity;
    }

    private int stringOfInt(String mode) {
        Log.i(TAG, "currentPosition=" + currentPosition);
        return 99;
    }

    private void showView(boolean one, boolean two, boolean three) {

    }


    private void initSelectBox() {
    }

    @Override
    protected void initView() {
        super.initView();
        leftOptionText("");
        rightOptionText("", R.drawable.action_menu);
    }

}